/** NodeWrap 组件样式 */
.node-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 48px;

  .node-wrap-box {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    width: 220px;
    min-height: 72px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;

    &::before {
      content: '';
      position: absolute;
      top: -12px;
      left: 50%;
      transform: translateX(-50%);
      width: 0;
      height: 4px;
      border-style: solid;
      border-width: 8px 6px 4px;
      border-color: #cacaca transparent transparent;
      background: #f5f5f7;
    }

    &::after {
      pointer-events: none;
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 2;
      border-radius: 4px;
      border: 1px solid transparent;
      transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
      box-shadow: 0 2px 5px 0 rgb(0 0 0 / 10%);
    }

    &:hover::after {
      border: 1px solid #3296fa;
      box-shadow: 0 0 6px 0 inset(50, 150, 250, 0.3);
    }

    &:hover .editable-title {
      border-bottom: dashed 1px #fff;
    }

    &.active .title .close,
    &:hover .title .close {
      display: block;
    }

    &.start-node::before {
      content: none;
    }

    .title {
      position: relative;
      display: flex;
      align-items: center;
      padding-left: 16px;
      padding-right: 30px;
      width: 100%;
      height: 24px;
      line-height: 24px;
      font-size: 12px;
      color: #fff;
      text-align: left;
      background: #576a95;
      border-radius: 4px 4px 0 0;

      .iconfont {
        margin-right: 5px;
      }

      .editable-title {
        line-height: 15px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      .editable-title-input {
        display: inline-block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        flex: none;
        height: 18px;
        z-index: 1;
      }

      .close {
        display: none;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        font-size: 14px;
        color: #fff;
        border-radius: 50%;
        text-align: center;
        line-height: 20px;
      }
    }

    .content {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 14px;
      padding: 16px;

      .placeholder {
        color: #bfbfbf;
      }
    }

    &.active::after {
      border: 1px solid #3296fa;
      box-shadow: 0 0 6px 0 rgb(50 150 250 / 30%);
    }

    &.error::after {
      border: 1px solid #f25643;
      box-shadow: 0 2px 5px 0 rgb(0 0 0 / 10%);
    }

    .error_tip {
      position: absolute;
      top: 0;
      right: 0;
      transform: translate(150%, 0);
      font-size: 24px;
    }
  }
}

/** 添加条件 node */
.branch-wrap {
  display: inline-block;
  width: 100%;

  .branch-box-wrap {
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    min-height: 270px;
    width: 100%;
    -ms-flex-negative: 0;
    flex-shrink: 0;

    .branch-box {
      display: flex;
      overflow: visible;
      min-height: 180px;
      height: auto;
      border-bottom: 2px solid #ccc;
      border-top: 2px solid #ccc;
      position: relative;
      margin-top: 15px;

      .add-branch {
        border: none;
        outline: none;
        user-select: none;
        justify-content: center;
        font-size: 12px;
        padding: 0 10px;
        height: 30px;
        line-height: 30px;
        border-radius: 15px;
        color: #0960bd;
        background: #fff;
        box-shadow: 0 2px 4px 0 rgb(0 0 0 / 10%);
        position: absolute;
        top: -16px;
        left: 50%;
        transform: translateX(-50%);
        transform-origin: center center;
        cursor: pointer;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
      }

      .add-branch:hover {
        transform: translateX(-50%) scale(1.1);
        box-shadow: 0 8px 16px 0 rgb(0 0 0 / 10%);
      }

      .col-box {
        position: relative;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        background: #f5f5f7;

        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          z-index: 0;
          margin: auto;
          width: 2px;
          height: 100%;
          background-color: #cacaca;
        }

        .condition-node {
          min-height: 220px;
          display: inline-flex;
          -webkit-box-orient: vertical;
          -webkit-box-direction: normal;
          flex-direction: column;
          -webkit-box-flex: 1;

          .condition-node-box {
            padding-top: 30px;
            padding-right: 50px;
            padding-left: 50px;
            -webkit-box-pack: center;
            justify-content: center;
            display: inline-flex;
            -webkit-box-align: center;
            align-items: center;
            -webkit-box-orient: vertical;
            -webkit-box-direction: normal;
            flex-direction: column;
            -webkit-box-flex: 1;
            flex-grow: 1;
            position: relative;

            &::before {
              content: '';
              position: absolute;
              top: 0;
              left: 0;
              right: 0;
              bottom: 0;
              margin: auto;
              width: 2px;
              height: 100%;
              background-color: #cacaca;
            }

            .auto-judge {
              position: relative;
              width: 220px;
              min-height: 72px;
              background: #fff;
              border-radius: 4px;
              padding: 14px 19px;
              cursor: pointer;

              .title-wrapper {
                position: relative;
                font-size: 12px;
                color: #15bc83;
                text-align: left;
                line-height: 16px;

                .editable-title-input {
                  display: inline-block;
                  max-width: 120px;
                  overflow: hidden;
                  white-space: nowrap;
                  text-overflow: ellipsis;
                  flex: none;
                  height: 18px;
                  z-index: 1;
                }

                .editable-title {
                  line-height: 15px;
                  display: inline-block;
                  max-width: 120px;
                  overflow: hidden;
                  white-space: nowrap;
                  text-overflow: ellipsis;
                  border-bottom: dashed 1px transparent;

                  &::before {
                    content: '';
                    position: absolute;
                    top: 0;
                    left: 0;
                    bottom: 0;
                    right: 40px;
                  }
                }

                .priority-title {
                  display: block;
                  float: right;
                  margin-right: 10px;
                  color: rgb(25 31 37 / 56%);
                }

                .copy {
                  width: 14px;
                  height: 14px;
                  display: none !important;
                  position: absolute;
                  right: 20px;
                  top: -8px;
                  font-size: 14px !important;
                  text-align: center;
                  line-height: 20px;
                  z-index: 2;
                }

                .close {
                  width: 14px;
                  height: 14px;
                  display: none !important;
                  position: absolute;
                  right: -2px;
                  top: -8px;
                  font-size: 14px !important;
                  text-align: center;
                  line-height: 20px;
                  z-index: 2;
                }
              }

              .content {
                font-size: 14px;
                color: #191f25;
                text-align: left;
                margin-top: 6px;
                overflow: hidden;
                text-overflow: ellipsis;
                -webkit-line-clamp: 3;
                -webkit-box-orient: vertical;
              }

              .sort-right {
                position: absolute;
                top: 0;
                bottom: 0;
                right: 0;
                display: none;
                z-index: 1;
                border-left: 1px solid #f6f6f6;

                &:hover {
                  background: #efefef;
                  border-color: rgb(25 31 37 / 8%);
                }
              }

              .sort-left {
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                display: none;
                z-index: 1;
                border-left: 1px solid #f6f6f6;

                &:hover {
                  background: #efefef;
                  border-color: rgb(25 31 37 / 8%);
                }
              }

              &:hover {
                &::after {
                  border: 1px solid #3296fa;
                  box-shadow: 0 0 6px 0 inset(50, 150, 250, 0.3);
                }

                .title-wrapper .editable-title {
                  border-color: #15bc83;
                }

                .title-wrapper .copy,
                .title-wrapper .close {
                  display: block !important;
                }

                .title-wrapper .priority-title {
                  display: none;
                }

                .sort-right {
                  display: flex;
                  align-items: center;
                }

                .sort-left {
                  display: flex;
                  align-items: center;
                }
              }

              &::after {
                pointer-events: none;
                content: '';
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 2;
                border-radius: 4px;
                border: 1px solid transparent;
                transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
                box-shadow: 0 2px 5px 0 rgb(0 0 0 / 10%);
              }

              &.active::after {
                border: 1px solid #3296fa;
                box-shadow: 0 0 6px 0 rgb(50 150 250 / 30%);
              }

              &.error::after {
                border: 1px solid #f25643;
                box-shadow: 0 2px 5px 0 rgb(0 0 0 / 10%);
              }
            }
          }
        }

        .top-left-cover-line {
          position: absolute;
          height: 3px;
          width: 50%;
          background: #f5f5f7;
          top: -2px;
          left: -1px;
        }

        .bottom-left-cover-line {
          position: absolute;
          height: 3px;
          width: 50%;
          background: #f5f5f7;
          bottom: -2px;
          left: -1px;
        }

        .top-right-cover-line {
          position: absolute;
          height: 3px;
          width: 50%;
          background: #f5f5f7;
          top: -2px;
          right: -1px;
        }

        .bottom-right-cover-line {
          position: absolute;
          height: 3px;
          width: 50%;
          background: #f5f5f7;
          bottom: -2px;
          right: -1px;
        }
      }
    }
  }
}

/** AddNode 组件样式 */
.add-node-btn {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 1;
  user-select: none;
  width: 240px;
  padding-top: 20px;
  padding-bottom: 40px;

  .add-node-popover-body {
    min-width: 336px;

    .add-node-popover-item {
      display: inline-flex;
      align-items: center;
      cursor: pointer;
      color: #191f25 !important;
      margin-right: 8px;
      margin-bottom: 8px;
      width: 160px;
      background: rgb(17 31 44 / 2%);
      padding: 8px;
      border: 1px solid #fff;
      border-radius: 4px;
    }
  }
}

/** WorkFlow 组件样式 */
.work-flow {
  position: relative;
  height: calc(100% - 56px);
  background: #f5f5f7;

  .design {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    overflow: auto;

    .zoom {
      position: fixed;
      margin-top: 30px;
      right: 40px;
      z-index: 10;
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 120px;
    }

    .container {
      position: relative;
      display: inline-block;
      width: 100%;
      padding: 54.5px 0;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;

      .end-node {
        border-radius: 50%;
        font-size: 14px;
        color: rgb(25 31 37 / 40%);
        text-align: left;

        .end-node-circle {
          width: 10px;
          height: 10px;
          margin: auto;
          border-radius: 50%;
          background: #dbdcdc;
        }

        .end-node-text {
          margin-top: 5px;
          text-align: center;
        }
      }
    }
  }
}

.ant-input {
  border-radius: 4px;
  border-color: rgb(25 31 37 / 12%) !important;
}

.error_tip {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(150%, 0);
  font-size: 24px;
}
